package com.boardgame.gwt.service.operate.action.buy;

import com.boardgame.common.entity.ResponseInfo;
import com.boardgame.gwt.data.GwtGameBoard;
import com.boardgame.gwt.data.GwtPlayerInfo;
import com.boardgame.gwt.service.operate.SyntaxBaseAction;
import com.boardgame.gwt.service.operate.SyntaxRequest;

import java.util.regex.Matcher;

/**
 * 买人行动
 */
public abstract class BuyWorkerBaseAction extends SyntaxBaseAction {

    public BuyWorkerBaseAction(){
        //选择工人的弹出框
        this.setTemplateHtml("select_worker");
        this.setTemplateControl("BuyWorkerAction");
    }
    @Override
    public ResponseInfo action(GwtGameBoard gwtGameBoard, SyntaxRequest syntaxRequest, Matcher matcher) {
        super.action(gwtGameBoard, syntaxRequest, matcher);
        //当前玩家
        GwtPlayerInfo gwtPlayer = super.gwtGameBoard.getCurrentPlayer();

        return ResponseInfo.Success(null);
    }

    /**
     * 额外花费
     * @return
     */
    protected abstract int getWorkerExtralCost();
}
